home *** CD-ROM | disk | FTP | other *** search
/ Aminet 1 / Aminet - June 1993 [Walnut Creek].iso / usenet / sources / volume90 / aplictns / dkbtrace / part08 < prev    next >
Encoding:
Internet Message Format  |  1990-09-03  |  31.4 KB

  1. Path: abcfd20.larc.nasa.gov!amiga-request
  2. From: amiga-request@abcfd20.larc.nasa.gov (Amiga Sources/Binaries Moderator)
  3. Subject: v90i256: DKBTrace 2.01 - DKBtrace Ray-Tracer, Part08/10
  4. Reply-To: David Schanen <mtv@milton.u.washington.edu>
  5. Newsgroups: comp.sources.amiga
  6. Message-ID: <comp.sources.amiga:v90i256@abcfd20.larc.nasa.gov>
  7. References: <comp.sources.amiga:v90i249@abcfd20.larc.nasa.gov>
  8. Date: 03 Sep 90 23:22:32 GMT
  9. Approved: tadguy@uunet.UU.NET (Tad Guy)
  10. X-Mail-Submissions-To: amiga@uunet.uu.net
  11. X-Post-Discussions-To: comp.sys.amiga
  12.  
  13. Submitted-by: David Schanen <mtv@milton.u.washington.edu>
  14. Posting-number: Volume 90, Issue 256
  15. Archive-name: applications/dkbtrace-2.01/part08
  16.  
  17. #!/bin/sh
  18. # This is a shell archive.  Remove anything before this line, then unpack
  19. # it by saving it into a file and typing "sh file".  To overwrite existing
  20. # files, type "sh file -c".  You can also feed this as standard input via
  21. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  22. # will see the following message at the end:
  23. #        "End of archive 8 (of 10)."
  24. # Contents:  src/texture.c
  25. # Wrapped by tadguy@abcfd20 on Mon Sep  3 19:21:21 1990
  26. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  27. if test -f 'src/texture.c' -a "${1}" != "-c" ; then 
  28.   echo shar: Will not clobber existing file \"'src/texture.c'\"
  29. else
  30. echo shar: Extracting \"'src/texture.c'\" \(28884 characters\)
  31. sed "s/^X//" >'src/texture.c' <<'END_OF_FILE'
  32. X/*****************************************************************************
  33. X*
  34. X*                                   texture.c
  35. X*
  36. X*   from DKBTrace (c) 1990  David Buck
  37. X*
  38. X*  This module implements solid texturing functions such as wood, marble, and
  39. X*  bozo.  The noise function used here is the one described by Ken Perlin in
  40. X*  "Hypertexture", SIGGRAPH '89 Conference Proceedings page 253.
  41. X*
  42. X* This software is freely distributable. The source and/or object code may be
  43. X* copied or uploaded to communications services so long as this notice remains
  44. X* at the top of each file.  If any changes are made to the program, you must
  45. X* clearly indicate in the documentation and in the programs startup message
  46. X* who it was who made the changes. The documentation should also describe what
  47. X* those changes were. This software may not be included in whole or in
  48. X* part into any commercial package without the express written consent of the
  49. X* author.  It may, however, be included in other public domain or freely
  50. X* distributed software so long as the proper credit for the software is given.
  51. X*
  52. X* This software is provided as is without any guarantees or warranty. Although
  53. X* the author has attempted to find and correct any bugs in the software, he
  54. X* is not responsible for any damage caused by the use of the software.  The
  55. X* author is under no obligation to provide service, corrections, or upgrades
  56. X* to this package.
  57. X*
  58. X* Despite all the legal stuff above, if you do find bugs, I would like to hear
  59. X* about them.  Also, if you have any comments or questions, you may contact me
  60. X* at the following address:
  61. X*
  62. X*     David Buck
  63. X*     22C Sonnet Cres.
  64. X*     Nepean Ontario
  65. X*     Canada, K2H 8W7
  66. X*
  67. X*  I can also be reached on the following bulleton boards:
  68. X*
  69. X*     ATX              (613) 526-4141
  70. X*     OMX              (613) 731-3419
  71. X*     Mystic           (613) 731-0088 or (613) 731-6698
  72. X*
  73. X*  Fidonet:   1:163/109.9
  74. X*  Internet:  David_Buck@Carleton.CA
  75. X*
  76. X*  IBM Port by Aaron A. Collins. Aaron may be reached on the following BBS'es:
  77. X*
  78. X*     Lattice BBS                      (708) 916-1200
  79. X*     The Information Exchange BBS     (708) 945-5575
  80. X*     Stillwaters BBS                  (708) 403-2826
  81. X*
  82. X*
  83. X*
  84. X*
  85. X*  The Noise and DNoise functions (and associated functions) were written by
  86. X*  Robert Skinner (robert@sgi.com) and are used here with his permission.
  87. X*  They are a lot better than the noise functions I had before!
  88. X*
  89. X*****************************************************************************/
  90. X
  91. X
  92. X#include "frame.h"
  93. X#include "vector.h"
  94. X#include "dkbproto.h"
  95. X
  96. Xextern long Calls_To_Noise, Calls_To_DNoise;
  97. X
  98. X#define MINX    -10000        /* Ridiculously large scaling values */
  99. X#define MINY    MINX
  100. X#define MINZ    MINX
  101. X
  102. X#define MAXSIZE 267
  103. X#define RNDMASK 0x7FFF
  104. X#define RNDDIVISOR (float) RNDMASK
  105. X#define NUMBER_OF_WAVES 10
  106. X#define SINTABSIZE 1000
  107. X#define EPSILON    (DBL) 0.00001
  108. X
  109. X#define FLOOR(x) ((x) >= 0.0 ? floor(x) : (0.0 - floor(0.0 - (x)) - 1.0))
  110. X#define FABS(x) ((x) < 0.0 ? (0.0 - x) : (x))
  111. X#define SCURVE(a) ((a)*(a)*(3.0-2.0*(a)))
  112. X#define REALSCALE ( 2.0 / 65535.0 )
  113. X#define Hash3d(a,b,c) hashTable[(int)(hashTable[(int)(hashTable[(int)((a) & 0xfffL)] ^ ((b) & 0xfffL))] ^ ((c) & 0xfffL))]
  114. X#define INCRSUM(m,s,x,y,z)    ((s)*(RTable[m]*0.5        \
  115. X                    + RTable[m+1]*(x)    \
  116. X                    + RTable[m+2]*(y)    \
  117. X                    + RTable[m+3]*(z)))
  118. X
  119. XDBL sintab [SINTABSIZE];
  120. XDBL frequency[NUMBER_OF_WAVES];
  121. XVECTOR Wave_Sources[NUMBER_OF_WAVES];
  122. XDBL    RTable[MAXSIZE];
  123. Xshort *hashTable;
  124. Xunsigned short crctab[256] =
  125. X{
  126. X   0x0000, 0xc0c1, 0xc181, 0x0140, 0xc301, 0x03c0, 0x0280, 0xc241,
  127. X   0xc601, 0x06c0, 0x0780, 0xc741, 0x0500, 0xc5c1, 0xc481, 0x0440,
  128. X   0xcc01, 0x0cc0, 0x0d80, 0xcd41, 0x0f00, 0xcfc1, 0xce81, 0x0e40,
  129. X   0x0a00, 0xcac1, 0xcb81, 0x0b40, 0xc901, 0x09c0, 0x0880, 0xc841,
  130. X   0xd801, 0x18c0, 0x1980, 0xd941, 0x1b00, 0xdbc1, 0xda81, 0x1a40,
  131. X   0x1e00, 0xdec1, 0xdf81, 0x1f40, 0xdd01, 0x1dc0, 0x1c80, 0xdc41,
  132. X   0x1400, 0xd4c1, 0xd581, 0x1540, 0xd701, 0x17c0, 0x1680, 0xd641,
  133. X   0xd201, 0x12c0, 0x1380, 0xd341, 0x1100, 0xd1c1, 0xd081, 0x1040,
  134. X   0xf001, 0x30c0, 0x3180, 0xf141, 0x3300, 0xf3c1, 0xf281, 0x3240,
  135. X   0x3600, 0xf6c1, 0xf781, 0x3740, 0xf501, 0x35c0, 0x3480, 0xf441,
  136. X   0x3c00, 0xfcc1, 0xfd81, 0x3d40, 0xff01, 0x3fc0, 0x3e80, 0xfe41,
  137. X   0xfa01, 0x3ac0, 0x3b80, 0xfb41, 0x3900, 0xf9c1, 0xf881, 0x3840,
  138. X   0x2800, 0xe8c1, 0xe981, 0x2940, 0xeb01, 0x2bc0, 0x2a80, 0xea41,
  139. X   0xee01, 0x2ec0, 0x2f80, 0xef41, 0x2d00, 0xedc1, 0xec81, 0x2c40,
  140. X   0xe401, 0x24c0, 0x2580, 0xe541, 0x2700, 0xe7c1, 0xe681, 0x2640,
  141. X   0x2200, 0xe2c1, 0xe381, 0x2340, 0xe101, 0x21c0, 0x2080, 0xe041,
  142. X   0xa001, 0x60c0, 0x6180, 0xa141, 0x6300, 0xa3c1, 0xa281, 0x6240,
  143. X   0x6600, 0xa6c1, 0xa781, 0x6740, 0xa501, 0x65c0, 0x6480, 0xa441,
  144. X   0x6c00, 0xacc1, 0xad81, 0x6d40, 0xaf01, 0x6fc0, 0x6e80, 0xae41,
  145. X   0xaa01, 0x6ac0, 0x6b80, 0xab41, 0x6900, 0xa9c1, 0xa881, 0x6840,
  146. X   0x7800, 0xb8c1, 0xb981, 0x7940, 0xbb01, 0x7bc0, 0x7a80, 0xba41,
  147. X   0xbe01, 0x7ec0, 0x7f80, 0xbf41, 0x7d00, 0xbdc1, 0xbc81, 0x7c40,
  148. X   0xb401, 0x74c0, 0x7580, 0xb541, 0x7700, 0xb7c1, 0xb681, 0x7640,
  149. X   0x7200, 0xb2c1, 0xb381, 0x7340, 0xb101, 0x71c0, 0x7080, 0xb041,
  150. X   0x5000, 0x90c1, 0x9181, 0x5140, 0x9301, 0x53c0, 0x5280, 0x9241,
  151. X   0x9601, 0x56c0, 0x5780, 0x9741, 0x5500, 0x95c1, 0x9481, 0x5440,
  152. X   0x9c01, 0x5cc0, 0x5d80, 0x9d41, 0x5f00, 0x9fc1, 0x9e81, 0x5e40,
  153. X   0x5a00, 0x9ac1, 0x9b81, 0x5b40, 0x9901, 0x59c0, 0x5880, 0x9841,
  154. X   0x8801, 0x48c0, 0x4980, 0x8941, 0x4b00, 0x8bc1, 0x8a81, 0x4a40,
  155. X   0x4e00, 0x8ec1, 0x8f81, 0x4f40, 0x8d01, 0x4dc0, 0x4c80, 0x8c41,
  156. X   0x4400, 0x84c1, 0x8581, 0x4540, 0x8701, 0x47c0, 0x4680, 0x8641,
  157. X   0x8201, 0x42c0, 0x4380, 0x8341, 0x4100, 0x81c1, 0x8081, 0x4040
  158. X};
  159. X
  160. X
  161. Xvoid Compute_Colour (Colour, Colour_Map, value)
  162. X   COLOUR *Colour;
  163. X   COLOUR_MAP *Colour_Map;
  164. X   DBL value;
  165. X   {
  166. X   register int i;
  167. X   COLOUR_MAP_ENTRY *Entry;
  168. X   register DBL fraction;
  169. X
  170. X   for (i = 0, Entry = &(Colour_Map->Colour_Map_Entries[0]) ; i < Colour_Map -> Number_Of_Entries ; i++, Entry++)
  171. X      if ((value >= Entry->start) && (value <= Entry->end))
  172. X      {
  173. X      fraction = (value - Entry->start) / (Entry->end - Entry->start);
  174. X      Colour -> Red = Entry->Start_Colour.Red + fraction * (Entry->End_Colour.Red - Entry->Start_Colour.Red);
  175. X      Colour -> Green = Entry->Start_Colour.Green + fraction * (Entry->End_Colour.Green - Entry->Start_Colour.Green);
  176. X      Colour -> Blue = Entry->Start_Colour.Blue + fraction * (Entry->End_Colour.Blue - Entry->Start_Colour.Blue);
  177. X      Colour -> Alpha = Entry->Start_Colour.Alpha + fraction * (Entry->End_Colour.Alpha - Entry->Start_Colour.Alpha);
  178. X      return;
  179. X      }
  180. X
  181. X   Colour -> Red = 0.0;
  182. X   Colour -> Green = 0.0;
  183. X   Colour -> Blue = 0.0;
  184. X   Colour -> Alpha = 0.0;
  185. X   printf ("No colour for value: %f\n", value);
  186. X   return;
  187. X   }
  188. X
  189. Xvoid Initialize_Noise ()
  190. X   {
  191. X   register int i = 0;
  192. X   VECTOR point;
  193. X
  194. X   InitRTable();
  195. X
  196. X   for (i = 0 ; i < SINTABSIZE ; i++)
  197. X      sintab[i] = sin(i/(DBL)SINTABSIZE * (3.14159265359 * 2.0));
  198. X
  199. X   for (i = 0 ; i < NUMBER_OF_WAVES ; i++)
  200. X      {
  201. X      DNoise (&point, (DBL) i, 0.0, 0.0);
  202. X      VNormalize (Wave_Sources[i], point);
  203. X      frequency[i] = (rand() & RNDMASK) / RNDDIVISOR + 0.01;
  204. X      }
  205. X   }
  206. X
  207. Xvoid InitTextureTable()
  208. X   {
  209. X   int i, j, temp;
  210. X
  211. X   srand(0);
  212. X
  213. X   hashTable = (short int *) malloc(4096*sizeof(short int));
  214. X   for (i = 0; i < 4096; i++)
  215. X      hashTable[i] = i;
  216. X   for (i = 4095; i >= 0; i--)
  217. X      {
  218. X      j = rand() % 4096;
  219. X      temp = hashTable[i];
  220. X      hashTable[i] = hashTable[j];
  221. X      hashTable[j] = temp;
  222. X      }
  223. X   }
  224. X
  225. X
  226. X/* modified by AAC to work properly with little bitty integers (16 bits) */
  227. X
  228. Xvoid InitRTable()
  229. X   {
  230. X   int i;
  231. X   VECTOR rp;
  232. X
  233. X   InitTextureTable();
  234. X
  235. X   for (i = 0; i < MAXSIZE; i++)
  236. X      {
  237. X      rp.x = rp.y = rp.z = (DBL)i;
  238. X      RTable[i] = (unsigned int) R(&rp) * REALSCALE - 1.0;
  239. X      }
  240. X   }
  241. X
  242. X
  243. Xint R(v)
  244. X   VECTOR *v;
  245. X   {
  246. X   v->x *= .12345;
  247. X   v->y *= .12345;
  248. X   v->z *= .12345;
  249. X
  250. X   return (Crc16((char *) v, sizeof(VECTOR)));
  251. X   }
  252. X
  253. X/*
  254. X * Note that passing a VECTOR array to Crc16 and interpreting it as
  255. X * an array of chars means that machines with different floating-point
  256. X * representation schemes will evaluate Noise(point) differently.
  257. X */
  258. X
  259. Xint Crc16(buf, count)
  260. X   register char *buf;
  261. X   register int  count;
  262. X   {
  263. X   register unsigned short crc = 0;
  264. X
  265. X   while (count--)
  266. X      crc = (crc >> 8) ^ crctab[ (unsigned char) (crc ^ *buf++) ];
  267. X
  268. X   return ((int) crc);
  269. X   }
  270. X
  271. X
  272. X/*
  273. X    Robert's Skinner's Perlin-style "Noise" function - modified by AAC
  274. X    to ensure uniformly distributed clamped values between 0 and 1.0...
  275. X*/
  276. X
  277. XDBL Noise(x, y, z)
  278. X   DBL x, y, z;
  279. X   {
  280. X   register long ix, iy, iz, jx, jy, jz;
  281. X   DBL sx, sy, sz, tx, ty, tz;
  282. X   DBL sum;
  283. X   short m;
  284. X
  285. X
  286. X   Calls_To_Noise++;
  287. X   /* ensures the values are positive. */
  288. X   x -= MINX;
  289. X   y -= MINY;
  290. X   z -= MINZ;
  291. X
  292. X   /* its equivalent integer lattice point. */
  293. X   ix = (long)x; iy = (long)y; iz = (long)z;
  294. X   jx = ix + 1; jy = iy + 1; jz = iz + 1;
  295. X
  296. X   sx = SCURVE(x - ix); sy = SCURVE(y - iy); sz = SCURVE(z - iz);
  297. X
  298. X   /* the complement values of sx,sy,sz */
  299. X   tx = 1.0 - sx; ty = 1.0 - sy; tz = 1.0 - sz;
  300. X
  301. X   /*
  302. X    *  interpolate!
  303. X    */
  304. X   m = Hash3d( ix, iy, iz ) & 0xFF;
  305. X   sum = INCRSUM(m,(tx*ty*tz),(x-ix),(y-iy),(z-iz));
  306. X
  307. X   m = Hash3d( jx, iy, iz ) & 0xFF;
  308. X   sum += INCRSUM(m,(sx*ty*tz),(x-jx),(y-iy),(z-iz));
  309. X
  310. X   m = Hash3d( ix, jy, iz ) & 0xFF;
  311. X   sum += INCRSUM(m,(tx*sy*tz),(x-ix),(y-jy),(z-iz));
  312. X
  313. X   m = Hash3d( jx, jy, iz ) & 0xFF;
  314. X   sum += INCRSUM(m,(sx*sy*tz),(x-jx),(y-jy),(z-iz));
  315. X
  316. X   m = Hash3d( ix, iy, jz ) & 0xFF;
  317. X   sum += INCRSUM(m,(tx*ty*sz),(x-ix),(y-iy),(z-jz));
  318. X
  319. X   m = Hash3d( jx, iy, jz ) & 0xFF;
  320. X   sum += INCRSUM(m,(sx*ty*sz),(x-jx),(y-iy),(z-jz));
  321. X
  322. X   m = Hash3d( ix, jy, jz ) & 0xFF;
  323. X   sum += INCRSUM(m,(tx*sy*sz),(x-ix),(y-jy),(z-jz));
  324. X
  325. X   m = Hash3d( jx, jy, jz ) & 0xFF;
  326. X   sum += INCRSUM(m,(sx*sy*sz),(x-jx),(y-jy),(z-jz));
  327. X
  328. X   sum = sum + 0.5;          /* range at this point -0.5 - 0.5... */
  329. X    
  330. X   if (sum < 0.0)
  331. X      sum = 0.0;
  332. X   if (sum > 1.0)
  333. X      sum = 1.0;
  334. X
  335. X   return (sum);
  336. X   }
  337. X
  338. X
  339. X/*
  340. X       Vector-valued version of "Noise"
  341. X*/
  342. X
  343. Xvoid DNoise(result, x, y, z)
  344. X   VECTOR *result;
  345. X   DBL x, y, z;
  346. X   {
  347. X   register long ix, iy, iz, jx, jy, jz;
  348. X   DBL px, py, pz, s;
  349. X   DBL sx, sy, sz, tx, ty, tz;
  350. X   short m;
  351. X
  352. X   Calls_To_DNoise++;
  353. X   /* ensures the values are positive. */
  354. X   x -= MINX;
  355. X   y -= MINY;
  356. X   z -= MINZ;
  357. X
  358. X   /* its equivalent integer lattice point. */
  359. X   ix = (long)x; iy = (long)y; iz = (long)z;
  360. X   jx = ix+1; jy = iy + 1; jz = iz + 1;
  361. X
  362. X   sx = SCURVE(x - ix); sy = SCURVE(y - iy); sz = SCURVE(z - iz);
  363. X
  364. X   /* the complement values of sx,sy,sz */
  365. X   tx = 1.0 - sx; ty = 1.0 - sy; tz = 1.0 - sz;
  366. X
  367. X   /*
  368. X    *  interpolate!
  369. X    */
  370. X   m = Hash3d( ix, iy, iz ) & 0xFF;
  371. X   px = x-ix;  py = y-iy;  pz = z-iz;
  372. X   s = tx*ty*tz;
  373. X   result->x = INCRSUM(m,s,px,py,pz);
  374. X   result->y = INCRSUM(m+4,s,px,py,pz);
  375. X   result->z = INCRSUM(m+8,s,px,py,pz);
  376. X
  377. X   m = Hash3d( jx, iy, iz ) & 0xFF;
  378. X   px = x-jx;
  379. X   s = sx*ty*tz;
  380. X   result->x += INCRSUM(m,s,px,py,pz);
  381. X   result->y += INCRSUM(m+4,s,px,py,pz);
  382. X   result->z += INCRSUM(m+8,s,px,py,pz);
  383. X
  384. X   m = Hash3d( jx, jy, iz ) & 0xFF;
  385. X   py = y-jy;
  386. X   s = sx*sy*tz;
  387. X   result->x += INCRSUM(m,s,px,py,pz);
  388. X   result->y += INCRSUM(m+4,s,px,py,pz);
  389. X   result->z += INCRSUM(m+8,s,px,py,pz);
  390. X
  391. X   m = Hash3d( ix, jy, iz ) & 0xFF;
  392. X   px = x-ix;
  393. X   s = tx*sy*tz;
  394. X   result->x += INCRSUM(m,s,px,py,pz);
  395. X   result->y += INCRSUM(m+4,s,px,py,pz);
  396. X   result->z += INCRSUM(m+8,s,px,py,pz);
  397. X
  398. X   m = Hash3d( ix, jy, jz ) & 0xFF;
  399. X   pz = z-jz;
  400. X   s = tx*sy*sz;
  401. X   result->x += INCRSUM(m,s,px,py,pz);
  402. X   result->y += INCRSUM(m+4,s,px,py,pz);
  403. X   result->z += INCRSUM(m+8,s,px,py,pz);
  404. X
  405. X   m = Hash3d( jx, jy, jz ) & 0xFF;
  406. X   px = x-jx;
  407. X   s = sx*sy*sz;
  408. X   result->x += INCRSUM(m,s,px,py,pz);
  409. X   result->y += INCRSUM(m+4,s,px,py,pz);
  410. X   result->z += INCRSUM(m+8,s,px,py,pz);
  411. X
  412. X   m = Hash3d( jx, iy, jz ) & 0xFF;
  413. X   py = y-iy;
  414. X   s = sx*ty*sz;
  415. X   result->x += INCRSUM(m,s,px,py,pz);
  416. X   result->y += INCRSUM(m+4,s,px,py,pz);
  417. X   result->z += INCRSUM(m+8,s,px,py,pz);
  418. X
  419. X   m = Hash3d( ix, iy, jz ) & 0xFF;
  420. X   px = x-ix;
  421. X   s = tx*ty*sz;
  422. X   result->x += INCRSUM(m,s,px,py,pz);
  423. X   result->y += INCRSUM(m+4,s,px,py,pz);
  424. X   result->z += INCRSUM(m+8,s,px,py,pz);
  425. X   }
  426. X
  427. XDBL Turbulence (x, y, z)
  428. X   DBL x, y, z;
  429. X   {
  430. X   register DBL pixelSize = 0.1;
  431. X   register DBL t = 0.0;
  432. X   register DBL scale, value;
  433. X
  434. X   for (scale = 1.0 ; scale > pixelSize ; scale *= 0.5) {
  435. X      value = Noise (x/scale, y/scale, z/scale);
  436. X      t += FABS (value) * scale;
  437. X      }
  438. X   return (t);
  439. X   }
  440. X
  441. Xvoid DTurbulence (result, x, y, z)
  442. X   VECTOR *result;
  443. X   DBL x, y, z;
  444. X   {
  445. X   register DBL pixelSize = 0.01;
  446. X   register DBL scale;
  447. X   VECTOR value;
  448. X
  449. X   result -> x = 0.0;
  450. X   result -> y = 0.0;
  451. X   result -> z = 0.0;
  452. X
  453. X   value.x = value.y = value.z = 0.0;
  454. X
  455. X   for (scale = 1.0 ; scale > pixelSize ; scale *= 0.5) {
  456. X      DNoise(&value, x/scale, y/scale, z/scale);
  457. X      result -> x += value.x * scale;
  458. X      result -> y += value.y * scale;
  459. X      result -> z += value.z * scale;
  460. X      }
  461. X   }
  462. X
  463. XDBL cycloidal (value)
  464. X   DBL value;
  465. X   {
  466. X
  467. X   if (value >= 0.0)
  468. X      return (sintab [(int)((value - floor (value)) * SINTABSIZE)]);
  469. X   else
  470. X      return (0.0 - sintab [(int)((0.0 - (value + floor (0.0 - value)))
  471. X                                    * SINTABSIZE)]);
  472. X   }
  473. X
  474. X
  475. XDBL Triangle_Wave (value)
  476. X   DBL value;
  477. X   {
  478. X   register DBL offset;
  479. X
  480. X   if (value >= 0.0) offset = value - floor(value);
  481. X   else offset = value - (-1.0 - floor(FABS(value)));
  482. X
  483. X   if (offset >= 0.5) return (2.0 * (1.0 - offset));
  484. X   else return (2.0 * offset);
  485. X   }
  486. X
  487. X
  488. Xint Bozo (x, y, z, Object, Colour)
  489. XDBL x, y, z;
  490. XOBJECT *Object;
  491. XCOLOUR *Colour;
  492. X   {
  493. X   register DBL noise, turb;
  494. X   COLOUR New_Colour;
  495. X   VECTOR BozoTurbulence;
  496. X
  497. X
  498. X   if ((turb = Object->Object_Texture->Turbulence) != 0.0)
  499. X      {
  500. X      DTurbulence (&BozoTurbulence, x, y, z);
  501. X      x += BozoTurbulence.x * turb;
  502. X      y += BozoTurbulence.y * turb;
  503. X      z += BozoTurbulence.z * turb;
  504. X      }
  505. X
  506. X   noise = Noise (x, y, z);
  507. X
  508. X   if (Object -> Object_Texture->Colour_Map != NULL) {
  509. X      Compute_Colour (&New_Colour, Object->Object_Texture->Colour_Map, noise);
  510. X      Colour -> Red += New_Colour.Red;
  511. X      Colour -> Green += New_Colour.Green;
  512. X      Colour -> Blue += New_Colour.Blue;
  513. X      Colour -> Alpha += New_Colour.Alpha;
  514. X      return (0);
  515. X      }
  516. X
  517. X   if (noise < 0.4) {
  518. X      Colour -> Red += 1.0;
  519. X      Colour -> Green += 1.0;
  520. X      Colour -> Blue += 1.0;
  521. X      return (0);
  522. X      }
  523. X
  524. X   if (noise < 0.6) {
  525. X      Colour -> Green += 1.0;
  526. X      return (0);
  527. X      }
  528. X
  529. X   if (noise < 0.8) {
  530. X      Colour -> Blue += 1.0;
  531. X      return (0);
  532. X      }
  533. X
  534. X   Colour -> Red += 1.0;
  535. X   return (0);
  536. X   }
  537. X
  538. Xint marble (x, y, z, Object, colour)
  539. X   DBL x, y, z;
  540. X   OBJECT *Object;
  541. X   COLOUR *colour;
  542. X   {
  543. X   register DBL noise, hue;
  544. X   COLOUR New_Colour;
  545. X
  546. X   noise = Triangle_Wave(x + Turbulence(x, y, z) * Object -> Object_Texture->Turbulence);
  547. X
  548. X   if (Object -> Object_Texture->Colour_Map != NULL)
  549. X      {
  550. X      Compute_Colour (&New_Colour, Object->Object_Texture->Colour_Map, noise);
  551. X      colour -> Red += New_Colour.Red;
  552. X      colour -> Green += New_Colour.Green;
  553. X      colour -> Blue += New_Colour.Blue;
  554. X      colour -> Alpha += New_Colour.Alpha;
  555. X      return (0);
  556. X      }
  557. X
  558. X   if (noise < 0.0)
  559. X      {
  560. X      colour -> Red += 0.9;
  561. X      colour -> Green += 0.8;
  562. X      colour -> Blue += 0.8;
  563. X      }
  564. X   else if (noise < 0.9)
  565. X      {
  566. X      colour -> Red += 0.9;
  567. X      hue = 0.8 - noise * 0.8;
  568. X      colour -> Green += hue;
  569. X      colour -> Blue += hue;
  570. X      }
  571. X   return (0);
  572. X   }
  573. X
  574. X
  575. Xvoid ripples (x, y, z, Object, Vector)
  576. X   DBL x, y, z;
  577. X   OBJECT *Object;
  578. X   VECTOR *Vector;
  579. X   {
  580. X   register int i;
  581. X   VECTOR point;
  582. X   register DBL length, scalar, index;
  583. X
  584. X   for (i = 0 ; i < NUMBER_OF_WAVES ; i++) {
  585. X      point.x = x;
  586. X      point.y = y;
  587. X      point.z = z;
  588. X      VSub (point, point, Wave_Sources[i]);
  589. X      VDot (length, point, point);
  590. X      if (length == 0.0)
  591. X         length = 1.0;
  592. X
  593. X      length = sqrt(length);
  594. X      index = length*Object->Object_Texture->Frequency
  595. X                    + Object -> Object_Texture->Phase;
  596. X      scalar = cycloidal (index) * Object -> Object_Texture->Bump_Amount;
  597. X      VScale (point, point, scalar/length/(DBL)NUMBER_OF_WAVES);
  598. X      VAdd (*Vector, *Vector, point);
  599. X      }
  600. X   VNormalize (*Vector, *Vector);
  601. X   }
  602. X
  603. Xvoid waves (x, y, z, Object, Vector)
  604. X   DBL x, y, z;
  605. X   OBJECT *Object;
  606. X   VECTOR *Vector;
  607. X   {
  608. X   register int i;
  609. X   VECTOR point;
  610. X   register DBL length, scalar, index, sinValue ;
  611. X
  612. X   for (i = 0 ; i < NUMBER_OF_WAVES ; i++) {
  613. X      point.x = x;
  614. X      point.y = y;
  615. X      point.z = z;
  616. X      VSub (point, point, Wave_Sources[i]);
  617. X      VDot (length, point, point);
  618. X      if (length == 0.0)
  619. X         length = 1.0;
  620. X
  621. X      length = sqrt(length);
  622. X      index = (length * Object -> Object_Texture->Frequency * frequency[i])
  623. X                   + Object -> Object_Texture->Phase;
  624. X      sinValue = cycloidal (index);
  625. X
  626. X      scalar =  sinValue * Object -> Object_Texture->Bump_Amount /
  627. X                  frequency[i];
  628. X      VScale (point, point, scalar/length/(DBL)NUMBER_OF_WAVES);
  629. X      VAdd (*Vector, *Vector, point);
  630. X      }
  631. X   VNormalize (*Vector, *Vector);
  632. X   }
  633. X
  634. Xint wood (x, y, z, Object, colour)
  635. X   DBL x, y, z;
  636. X   OBJECT *Object;
  637. X   COLOUR *colour;
  638. X   {
  639. X   register DBL noise, length;
  640. X   VECTOR WoodTurbulence;
  641. X   VECTOR point;
  642. X   COLOUR New_Colour;
  643. X
  644. X   DTurbulence (&WoodTurbulence, x, y, z);
  645. X
  646. X   point.x = cycloidal((x + WoodTurbulence.x)
  647. X               * Object -> Object_Texture->Turbulence);
  648. X   point.y = cycloidal((y + WoodTurbulence.y)
  649. X               * Object -> Object_Texture->Turbulence);
  650. X   point.z = 0.0;
  651. X
  652. X   point.x += x;
  653. X   point.y += y;
  654. X   point.z += z;
  655. X
  656. X   VLength (length, point);
  657. X
  658. X   noise = Triangle_Wave(length);
  659. X
  660. X   if (Object -> Object_Texture->Colour_Map != NULL) {
  661. X      Compute_Colour (&New_Colour, Object->Object_Texture->Colour_Map, noise);
  662. X      colour -> Red += New_Colour.Red;
  663. X      colour -> Green += New_Colour.Green;
  664. X      colour -> Blue += New_Colour.Blue;
  665. X      colour -> Alpha += New_Colour.Alpha;
  666. X      return (0);
  667. X      }
  668. X
  669. X   if (noise > 0.6) {
  670. X      colour -> Red += 0.4;
  671. X      colour -> Green += 0.133;
  672. X      colour -> Blue += 0.066;
  673. X      }
  674. X  else {
  675. X      colour -> Red += 0.666;
  676. X      colour -> Green += 0.312;
  677. X      colour -> Blue += 0.2;
  678. X      }
  679. X      return (0);
  680. X   }
  681. X
  682. X
  683. Xvoid checker (x, y, z, Object, colour)
  684. X   DBL x, y, z;
  685. X   OBJECT *Object;
  686. X   COLOUR *colour;
  687. X   {
  688. X   int brkindx;
  689. X
  690. X   brkindx = (int) FLOOR(x) + (int) FLOOR(z);
  691. X
  692. X   if (brkindx & 1)
  693. X      *colour = Object -> Object_Texture->Colour1;
  694. X   else
  695. X      *colour = Object -> Object_Texture->Colour2;
  696. X   return;
  697. X   }
  698. X
  699. X/*
  700. X   Ideas garnered from SIGGRAPH '85 Volume 19 Number 3, "An Image Synthesizer"
  701. X   By Ken Perlin.
  702. X*/
  703. X
  704. X
  705. X/*    
  706. X    With a little reflectivity and brilliance, can look like organ pipe
  707. X    metal.   With tiny scaling values can look like masonry or concrete.
  708. X    Works with color maps, supposedly. (?)
  709. X*/
  710. X
  711. Xvoid spotted (x, y, z, Object, Colour)
  712. X   DBL x, y, z;
  713. X   OBJECT *Object;
  714. X   COLOUR *Colour;
  715. X   {
  716. X   register DBL noise;
  717. X   COLOUR New_Colour;
  718. X
  719. X   noise = Noise (x, y, z);
  720. X
  721. X   if (Object -> Object_Texture->Colour_Map != NULL)
  722. X      {
  723. X      Compute_Colour (&New_Colour, Object->Object_Texture->Colour_Map, noise);
  724. X      Colour -> Red += New_Colour.Red;
  725. X      Colour -> Green += New_Colour.Green;
  726. X      Colour -> Blue += New_Colour.Blue;
  727. X      Colour -> Alpha += New_Colour.Alpha;
  728. X      return;
  729. X      }
  730. X
  731. X   Colour -> Red += noise;             /* "white (1.0) * noise" */
  732. X   Colour -> Green += noise;
  733. X   Colour -> Blue += noise;
  734. X
  735. X   return;
  736. X   }
  737. X
  738. Xvoid bumps (x, y, z, Object, normal)
  739. X   DBL x, y, z;
  740. X   OBJECT *Object;
  741. X   VECTOR *normal;
  742. X   {
  743. X   VECTOR bump_turb;
  744. X
  745. X   if (Object -> Object_Texture->Bump_Amount == 0.0)
  746. X      return;                            /* why are we here?? */
  747. X
  748. X   DNoise (&bump_turb, x, y, z);         /* Get Normal Displacement Val. */
  749. X   VScale(bump_turb, bump_turb, Object->Object_Texture->Bump_Amount);
  750. X   VAdd (*normal, *normal, bump_turb);   /* displace "normal" */
  751. X   VNormalize (*normal, *normal);        /* normalize normal! */
  752. X   return;
  753. X   }
  754. X
  755. X/*
  756. X   dents is similar to bumps, but uses noise() to control the amount of
  757. X   dnoise() perturbation of the object normal...
  758. X*/
  759. X
  760. Xvoid dents (x, y, z, Object, normal)
  761. X   DBL x, y, z;
  762. X   OBJECT *Object;
  763. X   VECTOR *normal;
  764. X   {
  765. X   VECTOR stucco_turb;
  766. X   DBL noise;
  767. X
  768. X   if (Object -> Object_Texture->Bump_Amount == 0.0)
  769. X      return;                           /* why are we here?? */
  770. X
  771. X   noise = Noise (x, y, z);
  772. X
  773. X   noise =  noise * noise * noise * Object->Object_Texture->Bump_Amount;
  774. X
  775. X   DNoise (&stucco_turb, x, y, z);       /* Get Normal Displacement Val. */
  776. X    
  777. X   VScale (stucco_turb, stucco_turb, noise);
  778. X   VAdd (*normal, *normal, stucco_turb); /* displace "normal" */
  779. X   VNormalize (*normal, *normal);        /* normalize normal! */
  780. X   return;
  781. X   }
  782. X
  783. X
  784. Xvoid agate (x, y, z, Object, colour)
  785. X   DBL x, y, z;
  786. X   OBJECT *Object;
  787. X   COLOUR *colour;
  788. X   {
  789. X   register DBL noise, hue;
  790. X   COLOUR New_Colour;
  791. X
  792. X   noise = cycloidal(1.3 * Turbulence(x, y, z) + 1.1 * z) + 1;
  793. X   noise *= 0.5;
  794. X   noise = pow(noise, 0.77);
  795. X
  796. X   if (Object -> Object_Texture->Colour_Map != NULL)
  797. X      {
  798. X      Compute_Colour (&New_Colour, Object->Object_Texture->Colour_Map, noise);
  799. X      colour -> Red += New_Colour.Red;
  800. X      colour -> Green += New_Colour.Green;
  801. X      colour -> Blue += New_Colour.Blue;
  802. X      colour -> Alpha += New_Colour.Alpha;
  803. X      return;
  804. X      }
  805. X
  806. X   hue = 1.0 - noise;
  807. X
  808. X   if (noise < 0.5)
  809. X      {
  810. X      colour -> Red += (1.0 - (noise / 10));
  811. X      colour -> Green += (1.0 - (noise / 5));
  812. X      colour -> Blue += hue;
  813. X      }
  814. X   else if (noise < 0.6)
  815. X      {
  816. X      colour -> Red += 0.9;
  817. X      colour -> Green += 0.7;
  818. X      colour -> Blue += hue;
  819. X      }
  820. X   else
  821. X      {
  822. X      colour -> Red += (0.6 + hue);
  823. X      colour -> Green += (0.3 + hue);
  824. X      colour -> Blue += hue;
  825. X      }
  826. X   return;
  827. X   }
  828. X
  829. X
  830. X/*
  831. X   Ideas garnered from the April 89 Byte Graphics Supplement on RenderMan,
  832. X   refined from "The RenderMan Companion, by Steve Upstill of Pixar, (C) 1990
  833. X   Addison-Wesley.
  834. X*/
  835. X
  836. X
  837. X/*
  838. X   wrinkles - This is my implementation of the dented() routine, using
  839. X   a surface iterative fractal derived from DTurbulence.  This is a 3-D vers.
  840. X   (thanks to DNoise()...) of the usual version using the singular Noise()...
  841. X   Seems to look a lot like wrinkles, however... (hmmm)
  842. X*/
  843. X
  844. Xvoid wrinkles (x, y, z, Object, normal)
  845. X   DBL x, y, z;
  846. X   OBJECT *Object;
  847. X   VECTOR *normal;
  848. X   {
  849. X   register int i;
  850. X   register DBL scale = 1.0;
  851. X   VECTOR result, value;
  852. X
  853. X   if (Object -> Object_Texture->Bump_Amount == 0.0)
  854. X      return;                                /* why are we here?? */
  855. X
  856. X   result.x = 0.0;
  857. X   result.y = 0.0;
  858. X   result.z = 0.0;
  859. X
  860. X   for (i = 0; i < 10 ; scale *= 2.0, i++)
  861. X      {
  862. X      DNoise(&value, x * scale, y * scale, z * scale);   /* * scale,*/
  863. X      result.x += FABS (value.x / scale);
  864. X      result.y += FABS (value.y / scale);
  865. X      result.z += FABS (value.z / scale);
  866. X      }
  867. X
  868. X   VScale(result, result, Object->Object_Texture->Bump_Amount);
  869. X   VAdd (*normal, *normal, result);             /* displace "normal" */
  870. X   VNormalize (*normal, *normal);               /* normalize normal! */
  871. X   return;
  872. X   }
  873. X
  874. X
  875. X/*
  876. X   Granite - kind of a union of the "spotted" and the "dented" textures,
  877. X   using a 1/f fractal noise function for color values.  Typically used
  878. X   w/ small scaling values.  Should work with colour maps for pink granite...
  879. X*/
  880. X
  881. X
  882. Xvoid granite (x, y, z, Object, Colour)
  883. X   DBL x, y, z;
  884. X   OBJECT *Object;
  885. X   COLOUR *Colour;
  886. X   {
  887. X   register int i;
  888. X   register DBL temp, noise = 0.0, freq = 1.0;
  889. X   COLOUR New_Colour;
  890. X
  891. X   for (i = 0; i < 6 ; freq *= 2.0, i++)
  892. X      {
  893. X      temp = 0.5 - Noise (x * 4 * freq, y * 4 * freq, z * 4 * freq);
  894. X      temp = FABS(temp);
  895. X      noise += temp / freq;
  896. X      }
  897. X
  898. X   if (Object -> Object_Texture->Colour_Map != NULL)
  899. X      {
  900. X      Compute_Colour (&New_Colour, Object->Object_Texture->Colour_Map, noise);
  901. X      Colour -> Red += New_Colour.Red;
  902. X      Colour -> Green += New_Colour.Green;
  903. X      Colour -> Blue += New_Colour.Blue;
  904. X      Colour -> Alpha += New_Colour.Alpha;
  905. X      return;
  906. X      }
  907. X
  908. X   Colour -> Red += noise;                  /* "white (1.0) * noise" */
  909. X   Colour -> Green += noise;
  910. X   Colour -> Blue += noise;
  911. X
  912. X   return;
  913. X   }
  914. X
  915. X/*
  916. X   Further Ideas Garnered from "The RenderMan Companion" (Addison Wesley)
  917. X*/
  918. X
  919. X
  920. X/*
  921. X   Color Gradient Texture - gradient based on the fractional values of x, y or
  922. X   z, based on whether or not the given directional vector is a 1.0 or a 0.0.
  923. X   Note - ONLY works with colour maps, preferably one that is circular - i.e.
  924. X   the last defined colour (value 1.001) is the same as the first colour (with
  925. X   a value of 0.0) in the map.  The basic concept of this is from DBW Render,
  926. X   but Dave Wecker's only supports simple Y axis gradients.
  927. X*/
  928. X
  929. Xvoid gradient (x, y, z, Object, Colour)
  930. X   DBL x, y, z;
  931. X   OBJECT *Object;
  932. X   COLOUR *Colour;
  933. X   {
  934. X   COLOUR New_Colour;
  935. X   DBL value = 0.0, turb;
  936. X   VECTOR GradTurbulence;
  937. X
  938. X   if ((turb = Object->Object_Texture->Turbulence) != 0.0)
  939. X      {
  940. X      DTurbulence (&GradTurbulence, x, y, z);
  941. X      x += GradTurbulence.x * turb;
  942. X      y += GradTurbulence.y * turb;
  943. X      z += GradTurbulence.z * turb;
  944. X      }
  945. X
  946. X   if (Object -> Object_Texture->Colour_Map == NULL)
  947. X      return;
  948. X   if (Object -> Object_Texture->Texture_Gradient.x != 0.0)
  949. X      {
  950. X      x = FABS(x);
  951. X      value += x - FLOOR(x);    /* obtain fractional X component */
  952. X      }
  953. X   if (Object -> Object_Texture->Texture_Gradient.y != 0.0)
  954. X      {
  955. X      y = FABS(y);
  956. X      value += y - FLOOR(y);    /* obtain fractional Y component */
  957. X   }
  958. X   if (Object -> Object_Texture->Texture_Gradient.z != 0.0)
  959. X      {
  960. X      z = FABS(z);
  961. X      value += z - FLOOR(z);    /* obtain fractional Z component */
  962. X      }
  963. X   value = ((value > 1.0) ? fmod(value, 1.0) : value); /* clamp to 1.0 */
  964. X   Compute_Colour(&New_Colour, Object->Object_Texture->Colour_Map, value);
  965. X   Colour -> Red += New_Colour.Red;
  966. X   Colour -> Green += New_Colour.Green;
  967. X   Colour -> Blue += New_Colour.Blue;
  968. X   Colour -> Alpha += New_Colour.Alpha;
  969. X   return;
  970. X   }
  971. X
  972. X/*
  973. X   2-D to 3-D Procedural Texture Mapping of a Bitmapped Image onto an Object:
  974. X       
  975. X   Simplistic method of object image projection devised by DKB and AAC.
  976. X
  977. X   1. Transform texture in 3-D space if requested.
  978. X   2. Determine local object 2-d coords from 3-d coords by <X Y Z> triple.
  979. X   3. Return pixel color value at that position on the 2-d plane of "Image".
  980. X   3. Map colour value in Image [0..255] to a more normal colour range [0..1].
  981. X*/
  982. X
  983. Xvoid texture_map (x, y, z, Object, colour)
  984. X   DBL x, y, z;
  985. X   OBJECT *Object;
  986. X   COLOUR *colour;
  987. X   {
  988. X   /* determine local object 2-d coords from 3-d coords */
  989. X   /* "unwrap" object 2-d coord onto flat 2-d plane */
  990. X   /* return pixel color value at that posn on 2-d plane */
  991. X
  992. X   int xcoor, ycoor, index;
  993. X   TEXTURE *local_texture;
  994. X   DBL width, height, turb;
  995. X   VECTOR TextureTurbulence;
  996. X
  997. X   local_texture = Object->Object_Texture;
  998. X
  999. X   if ((turb = local_texture->Turbulence) != 0.0)
  1000. X      {
  1001. X      DTurbulence (&TextureTurbulence, x, y, z);
  1002. X      x += TextureTurbulence.x * turb;
  1003. X      y += TextureTurbulence.y * turb;
  1004. X      z += TextureTurbulence.z * turb;
  1005. X      }
  1006. X
  1007. X   width = local_texture->Image->width;
  1008. X   height = local_texture->Image->height;
  1009. X
  1010. X   if (local_texture -> Texture_Gradient.x != 0.0) {
  1011. X      if ((local_texture->Once_Flag) &&
  1012. X           ((x < 0.0) || (x > 1.0))) {
  1013. X         *colour = Object -> Object_Colour;
  1014. X         return;
  1015. X         }
  1016. X
  1017. X      if (local_texture -> Texture_Gradient.x > 0)
  1018. X         xcoor = (int) fmod (x * width, width);
  1019. X      else ycoor = (int) fmod (x * height, height);
  1020. X      }
  1021. X
  1022. X   if (local_texture -> Texture_Gradient.y != 0.0) {
  1023. X      if ((local_texture->Once_Flag) &&
  1024. X           ((y < 0.0) || (y > 1.0))) {
  1025. X         *colour = Object -> Object_Colour;
  1026. X         return;
  1027. X         }
  1028. X
  1029. X      if (local_texture -> Texture_Gradient.y > 0)
  1030. X         xcoor = (int) fmod (y * width, width);
  1031. X      else ycoor = (int) fmod (y * height, height);
  1032. X      }
  1033. X
  1034. X   if (local_texture -> Texture_Gradient.z != 0.0) {
  1035. X      if ((local_texture->Once_Flag) &&
  1036. X           ((z < 0.0) || (z > 1.0))) {
  1037. X         *colour = Object -> Object_Colour;
  1038. X         return;
  1039. X         }
  1040. X
  1041. X      if (local_texture -> Texture_Gradient.z > 0)
  1042. X         xcoor = (int) fmod (z * width, width);
  1043. X      else ycoor = (int) fmod (z * height, height);
  1044. X      }
  1045. X
  1046. X   if (xcoor < 0)
  1047. X      xcoor += local_texture->Image->iwidth;
  1048. X   if (ycoor < 0)
  1049. X      ycoor += local_texture->Image->iheight;
  1050. X
  1051. X   if ((xcoor >= local_texture->Image->iwidth) ||
  1052. X       (ycoor >= local_texture->Image->iheight) ||
  1053. X       (xcoor < 0) || (ycoor < 0))
  1054. X     printf ("Out of range\n");
  1055. X
  1056. X   index = (unsigned)ycoor* (unsigned)local_texture->Image->iwidth +
  1057. X           (unsigned)xcoor;
  1058. X
  1059. X   Make_Colour (colour, (DBL) local_texture->Image->red[index]/255.0,
  1060. X                        (DBL) local_texture->Image->green[index]/255.0,
  1061. X                        (DBL) local_texture->Image->blue[index]/255.0);
  1062. X   }
  1063. X
  1064. END_OF_FILE
  1065. if test 28884 -ne `wc -c <'src/texture.c'`; then
  1066.     echo shar: \"'src/texture.c'\" unpacked with wrong size!
  1067. fi
  1068. # end of 'src/texture.c'
  1069. fi
  1070. echo shar: End of archive 8 \(of 10\).
  1071. cp /dev/null ark8isdone
  1072. MISSING=""
  1073. for I in 1 2 3 4 5 6 7 8 9 10 ; do
  1074.     if test ! -f ark${I}isdone ; then
  1075.     MISSING="${MISSING} ${I}"
  1076.     fi
  1077. done
  1078. if test "${MISSING}" = "" ; then
  1079.     echo You have unpacked all 10 archives.
  1080.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1081. else
  1082.     echo You still need to unpack the following archives:
  1083.     echo "        " ${MISSING}
  1084. fi
  1085. ##  End of shell archive.
  1086. exit 0
  1087. -- 
  1088. Mail submissions (sources or binaries) to <amiga@uunet.uu.net>.
  1089. Mail comments to the moderator at <amiga-request@uunet.uu.net>.
  1090. Post requests for sources, and general discussion to comp.sys.amiga.
  1091.